<!DOCTYPE html>
<html lang="en">
<head>
	{include file='public/header' /}
	<!-- Fancy-Buttons CSS -->
	<link href="__PUBLIC__/admin/dist/css/fancy-buttons.css" rel="stylesheet" type="text/css">

	<!-- switchery CSS -->
	<link href="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.css" rel="stylesheet" type="text/css"/>
	<!-- Custom CSS -->
	{include file='public/comn_css' /}
</head>

<body>
<!--Preloader-->
<div class="preloader-it">
	<div class="la-anim-1"></div>
</div>
<!--/Preloader-->
<div class="wrapper  theme-5-active pimary-color-blue">

	<!-- Top Menu Items -->
	{include file='public/top_menu' /}
	<!-- /Top Menu Items -->

	<!-- Left Sidebar Menu -->
	{include file='public/sidebar' /}
	<!-- /Left Sidebar Menu -->

	<!-- Main Content -->
	<div class="page-wrapper">
		<div class="container-fluid">

			<!-- Title -->
			<div class="row heading-bg">
				<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
					<h5 class="txt-dark">生成首页</h5>
				</div>
				<!-- Breadcrumb -->
				<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
					<ol class="breadcrumb">
						<li><a href="{:url('admin/index/index')}">系统首页</a></li>
						<li class="active"><span>生成首页</span></li>
					</ol>
				</div>
				<!-- /Breadcrumb -->
			</div>
			<!-- /Title -->

			<div class="row">
				<!-- Table Hover -->
				<div class="col-sm-12">
					<div class="panel panel-default card-view">
						<div class="panel-wrapper collapse in">
							<div class="panel-body">
								<div class="table-wrap">
									<div class="table-responsive">
										<table class="table table-hover table-bordered mb-0">
											<tr>
												<td class="text-center">
													{eq name='status' value='1'}
													<a class="btn btn-primary" href="{$Think.config.site_domain}" target="_blank">预览主页</a>
													<a class="btn btn-primary" onclick="create_home_page();">更新主页</a>
													{else /}
													当前未开启静态化，无法生成首页
													{/eq}
												</td>
											</tr>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- /Table Hover -->
			</div>

		</div>

		<!-- Footer -->
		{include file='public/footer' /}
		<!-- /Footer -->

	</div>
	<!-- /Main Content -->

</div>
<!-- /#wrapper -->

<!-- JavaScript -->

<!-- jQuery -->
<script src="__PUBLIC__/admin/vendors/bower_components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- Piety JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/peity/jquery.peity.min.js"></script>
<script src="__PUBLIC__/admin/dist/js/peity-data.js"></script>

<!-- Slimscroll JavaScript -->
<script src="__PUBLIC__/admin/dist/js/jquery.slimscroll.js"></script>

<!-- Owl JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

<!-- Switchery JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.js"></script>

<!-- Fancy Dropdown JS -->
<script src="__PUBLIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>

<!-- Init JavaScript -->
{include file='public/comn_js' /}

<script src="__PUBLIC__/admin/vendors/layer/layer.js"></script>

<script>
	function create_home_page() {
	    var index = layer.load(1, {shade: [0.6, '#000']});
		$.post("{:url('doCreateHomePage')}", {status:1}, function (data) {
			if (data)
			{
			    layer.msg('生成成功！', function () {
                    layer.close(index);
                })
			}
        })
    }
</script>
</body>

</html>
